package com.zyz.L_泛型.通配符;

/**
 * @author: vick
 * @Date: 2025/4/2
 * @Description:
 * @version: 1.0
 */
public class UserServiceTest {
    public static void main(String[] args) {
        UserService<String> service = new UserService<>();
        service.setName("vick");
        change(service);

        UserService<Integer> service2 = new UserService<>();
        service2.setName(11);
        change(service2);
    }

    public static void change(UserService<?> service) {
        //只能获取，不能修改
        //service.setName(20);
        System.out.println(service.getName());
    }
}
